package com.shibida.shibidaProject.menu.controller;

import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/menu")
@CrossOrigin
public class MenuController {

    @GetMapping("/list")
    @ResponseBody
    public List<Map<String, String>> list(){
        List<Map<String, String>> menuList = new ArrayList<>();

        HashMap<String, String> menu = new HashMap<>();
        menu.put("label", "学生信息管理");
        menu.put("path", "/student");
        menu.put("icon", "User");
        HashMap<String, String> menu1 = new HashMap<>();
        menu1.put("label", "老师信息管理");
        menu1.put("path", "/teacher");
        menu1.put("icon", "Search");
        HashMap<String, String> menu2 = new HashMap<>();
        menu2.put("label", "课程信息管理");
        menu2.put("path", "/project");
        menu2.put("icon", "Flag");
        menuList.add(menu);
        menuList.add(menu1);
        menuList.add(menu2);
        return menuList;
    }
}
